﻿using System;
namespace Producers.Arireg.Xtee.Riik.Ee.Producer.Arireg {
    
    
    public partial class Receiver : global::Producers.Arireg.Xtee.Riik.Ee.Producer.Arireg.IReceiver {
        
        private Receiver.NameType @__name;
        
        private Receiver.RegNumType @__regNum;
        
        private Receiver.AccountNumType @__accountNum;
        
        private Receiver.RefNumType @__refNum;
        
        private Receiver.ReceptionDateType @__receptionDate;
        
        public Receiver() {
        }
        
        /// <summary>
        /// All parameters
        /// </summary>
        public Receiver(Receiver.NameType @name, Receiver.RegNumType @regNum, Receiver.AccountNumType @accountNum, Receiver.RefNumType @refNum, Receiver.ReceptionDateType @receptionDate) {
            this.@__name = @name;
            this.@__regNum = @regNum;
            this.@__accountNum = @accountNum;
            this.@__refNum = @refNum;
            this.@__receptionDate = @receptionDate;
        }
        
        /// <summary>
        /// Required parameters
        /// </summary>
        public Receiver(Receiver.NameType @name, Receiver.RegNumType @regNum) {
            this.@__name = @name;
            this.@__regNum = @regNum;
        }
        
        /// <summary>
        /// Copy Constructor
        /// </summary>
        protected Receiver(IReceiver @receiver) {
            this.@__name = @receiver.Name;
            this.@__regNum = @receiver.RegNum;
            this.@__accountNum = @receiver.AccountNum;
            this.@__refNum = @receiver.RefNum;
            this.@__receptionDate = @receiver.ReceptionDate;
        }
        
        public virtual Receiver.NameType Name {
            get {
                return this.@__name;
            }
            set {
                this.@__name = value;
            }
        }
        
        public virtual Receiver.RegNumType RegNum {
            get {
                return this.@__regNum;
            }
            set {
                this.@__regNum = value;
            }
        }
        
        public virtual Receiver.AccountNumType AccountNum {
            get {
                return this.@__accountNum;
            }
            set {
                this.@__accountNum = value;
            }
        }
        
        public virtual Receiver.RefNumType RefNum {
            get {
                return this.@__refNum;
            }
            set {
                this.@__refNum = value;
            }
        }
        
        public virtual Receiver.ReceptionDateType ReceptionDate {
            get {
                return this.@__receptionDate;
            }
            set {
                this.@__receptionDate = value;
            }
        }
        
        public class NameType : global::Xtee.Core.Schema.XsdString {
            
            public NameType(string value) : 
                    base(value) {
                this.PikkusSuuremVõrdneKui = 0;
                this.PikkusVaiksemVordneKui = 80;
                this.Validate();
            }
            
            public NameType() : 
                    base(string.Empty) {
            }
            
            public static bool TryParse(string value, out NameType result) {
                try {
                    result = new NameType(value);
                    return true;
                }
                catch (System.Exception ) {
                    result = null;
                    return false;
                }
            }
            
            public static implicit operator String (NameType value) {
                return value.Value;
            }
            
            public static implicit operator NameType (string value) {
                if (value==null) {
                    return null;
                }
                return new NameType(value);
            }
        }
        
        public class RegNumType : global::Xtee.Core.Schema.XsdString {
            
            public RegNumType(string value) : 
                    base(value) {
                this.PikkusSuuremVõrdneKui = 0;
                this.PikkusVaiksemVordneKui = 15;
                this.Validate();
            }
            
            public RegNumType() : 
                    base(string.Empty) {
            }
            
            public static bool TryParse(string value, out RegNumType result) {
                try {
                    result = new RegNumType(value);
                    return true;
                }
                catch (System.Exception ) {
                    result = null;
                    return false;
                }
            }
            
            public static implicit operator String (RegNumType value) {
                return value.Value;
            }
            
            public static implicit operator RegNumType (string value) {
                if (value==null) {
                    return null;
                }
                return new RegNumType(value);
            }
        }
        
        public class AccountNumType : global::Xtee.Core.Schema.XsdString {
            
            public AccountNumType(string value) : 
                    base(value) {
                this.PikkusSuuremVõrdneKui = 0;
                this.PikkusVaiksemVordneKui = 35;
                this.Validate();
            }
            
            public AccountNumType() : 
                    base(string.Empty) {
            }
            
            public static bool TryParse(string value, out AccountNumType result) {
                try {
                    result = new AccountNumType(value);
                    return true;
                }
                catch (System.Exception ) {
                    result = null;
                    return false;
                }
            }
            
            public static implicit operator String (AccountNumType value) {
                return value.Value;
            }
            
            public static implicit operator AccountNumType (string value) {
                if (value==null) {
                    return null;
                }
                return new AccountNumType(value);
            }
        }
        
        public class RefNumType : global::Xtee.Core.Schema.XsdString {
            
            public RefNumType(string value) : 
                    base(value) {
                this.PikkusSuuremVõrdneKui = 0;
                this.PikkusVaiksemVordneKui = 20;
                this.Validate();
            }
            
            public RefNumType() : 
                    base(string.Empty) {
            }
            
            public static bool TryParse(string value, out RefNumType result) {
                try {
                    result = new RefNumType(value);
                    return true;
                }
                catch (System.Exception ) {
                    result = null;
                    return false;
                }
            }
            
            public static implicit operator String (RefNumType value) {
                return value.Value;
            }
            
            public static implicit operator RefNumType (string value) {
                if (value==null) {
                    return null;
                }
                return new RefNumType(value);
            }
        }
        
        public class ReceptionDateType : global::Xtee.Core.Schema.XsdString {
            
            public ReceptionDateType(string value) : 
                    base(value) {
                this.PikkusVordne = 10;
                this.Pattern = @"\d{2}/\d{2}/\d{4}";
                this.Validate();
            }
            
            public ReceptionDateType() : 
                    base(string.Empty) {
            }
            
            public static bool TryParse(string value, out ReceptionDateType result) {
                try {
                    result = new ReceptionDateType(value);
                    return true;
                }
                catch (System.Exception ) {
                    result = null;
                    return false;
                }
            }
            
            public static implicit operator String (ReceptionDateType value) {
                return value.Value;
            }
            
            public static implicit operator ReceptionDateType (string value) {
                if (value==null) {
                    return null;
                }
                return new ReceptionDateType(value);
            }
        }
    }
}
